<?php
require 'user.php';
require 'function.php';
if((file_exists($path=_decode($_GET['path']))==false)) {
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
Error：404
HTML;
exit;
}
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
<html>
<head>
<title>SVN 属性列表</title>
<style type="text/css">
.big_board{background-color:#009BCE;color:#FFF;}
.board_title{margin-bottom:1px;border:1px solid #09F;}
</style>
</head>
<body>
<div class="big_board"><div class="board_title">爱特文管－路径信息</div></div>
HTML;
echo '<a href="index.php?path='._encode(dirname(realpath($path))).'">'.dirname(realpath($path)).'</a>/'.basename($path);
/*if($_POST['go']!=null) {*/
if(($r=$_POST['r'])=="") $r='当前';
echo <<<HTML
<div class="big_board"><div class="board_title">属性列表($r)[<a href="propset.php?path=$_GET[path]">添加</a>]</div></div>
HTML;
$r=escapeshellarg($_POST['r'] ? $_POST['r'] : 'BASE');
$pth=escapeshellarg(svnpath($path));
$cmd="svn proplist $pth".($isr=$_POST['r'] ? " -r $r" : "")." -q $_SESSION[key]";
$nr=cmd($cmd);
$list=explode("\n",str_replace(array("\r\n","\r"),"\n",$nr));
if(strpos(trim($list[0])," ")!==false)
 echo htmlcode($nr);
else{
foreach($list as $n)
 {
$n=trim($n);
if($n=="") continue;
echo '(<a href="propset.php?path='.$_GET['path'].'&amp;name='.$n.'&amp;r='.$_POST['r'].'&amp;edit=1">改</a>|<a href="propdel.php?path='.$_GET['path'].'&amp;name='.$n.'">删</a>)'.$n.'=';
echo htmlcode(iconv_substr($x=cmd("svn propget $n $pth$isr --strict $_SESSION[key]","utf-8","temp"),0,100,"utf-8"));
if(iconv_strlen($x,"utf-8")>100) echo "……";
echo '<br/>';
 }
}
/*}*/
echo <<<HTML
<div class="big_board"><div class="board_title">指定版本</div></div>
HTML;
echo '<form action="'.$_SERVER['PHP_SELF'].'?path='.$_GET['path'].'" method="post">';
echo '版本: <input name="r" value="HEAD"/>';
echo '<input type="submit" name="go" value="查看"/><br/>（可能会连接超时。如果超时，<a href="status.php?path='.$_GET['path'].'&amp;onlyshow=1">点击这里查看属性列表</a>）';
echo '</form>';
echo <<<HTML
<div class="big_board"><div class="board_title">By：Admin@Lspecial.Com</div></div>
</body>
</html>
HTML;
?>